package com.hn.gege.sys.modules.tt.service.impl;

import com.hn.gege.sys.modules.tt.entity.Tc;
import com.hn.gege.sys.modules.tt.mapper.TcMapper;
import com.hn.gege.sys.modules.tt.service.ITcService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zxy
 * @since 2021-09-18
 */
@Service
public class TcServiceImpl extends ServiceImpl<TcMapper, Tc> implements ITcService {

    @Override
    public Tc getByPk(String id) {
        LambdaQueryWrapper<Tc> lambda = new QueryWrapper<Tc>().lambda()
                .eq(Tc::getId, id);
        return baseMapper.selectOne(lambda);
    }

    @Override
    public boolean updateByPk(Tc tc) {
        LambdaQueryWrapper<Tc> lambda = new QueryWrapper<Tc>().lambda()
                .eq(Tc::getId, tc.getId());
        return super.update(tc, lambda);
    }

    @Override
    public boolean removeByPk(String id) {
        LambdaQueryWrapper<Tc> lambda = new QueryWrapper<Tc>().lambda()
                .eq(Tc::getId, id);
        return super.remove(lambda);
    }

    @Override
    public int updateTest(Tc tc) {
        return baseMapper.updateTest(tc);
    }

    @Override
    public int deleteTest(Tc tc) {
        return baseMapper.deleteTest(tc);
    }

}
